package com.zz.man.controller;

import com.zz.man.properties.Manproperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/hello")
public class HelloController {
    @Autowired
    private Manproperties mManproperties;
//    @Value("${name}")
////    private String name;
////
////    @Value("${age}")
////    private int age;

//    @RequestMapping(value = {"/say/{id}","/{id}/speak"}, method = RequestMethod.GET)
//    public String saytwo(@PathVariable("id") Integer id){
//        return mManproperties.getName()+mManproperties.getAge()+"Hello Spring boot"+"体重"+id;
//    }

    @RequestMapping(value = {"/say","/speak"}, method = RequestMethod.GET)
    public String say(@RequestParam(value = "id",required = false,defaultValue = "0") Integer myid,@RequestParam("age") Integer age){
        return mManproperties.getName()+age+"Hello Spring boot"+"体重"+myid+"kg";

    }
    @RequestMapping(value = "/toHtml", method = RequestMethod.GET)
    public String write(){
        return "index";
    }


}
